Commit 3

fixing errors
Commit 4

Final code