Activated disabled code and added comments

-Uncommented disabled code
-Added comments to functions