Final with comments

This is fully functioning code with added comments