+ replace float with double
+ improved comments