Updated original file

Wrote functions and added first set of comments.