revision according to #29 (closed).
In addition, I deleted .astype('float16') at the tail of the function
.astype('float16')