switched to float arithmetics
reduce memory allocations