Added some (float) typecasting for windows compiler to work