fixing bugs, adding comments

YAY