updated with the new syntax + for loops