Started to write generator functions