fix my horrible js igrnorance
fix rounding and remove constants