Commenting code and cleaning up unused variables