changed to avoid built-in range function