homework-3 (second commit)

Fully working version