Added comments and changed a few variable names