make algorithm easier to understand