Replaced sin() and cos() by sinf() and cosf() respectively