Changed the type of variable y to float