cleaned up code & comments