added int conversion for float in loop