Fixed some issues with using int instead of double. looks okay now.