Use for cycle instead of while for better readability