changed parseInt to parseFloat, improved behaviour but still issues with truncation