cleaning up unnecessary assignments and added more comments