Code works! [todo]

todo - add coments to each line to explain what it does.