updated with different ways of iterate over points