Fixed local variable names
Changed the type of variable y to float