started working on demo 3 code