needs testing: did not change much at all just removed some unused variables OR commented them if i wasn't sure they were needed, added more comments