Changed everything to use doubles and fixed comparison operators