Added some comments

Added a bunch of comments for the functions