move conversion from double to int to algorithm code