Added comments and loop to handle operations

poop a loop