Change double type to float and remove pointers as arguments