Completed Assignment 2 with comments written in the file for clarity.