Translation of For - TODO: check solution