Cleaned up some of unused variables and added comments