added comments and changed a for loop lol