Removed unused variables. cleaned up formatting