Removed some inaccurate forced typecasting to int