Added comments,  Tried to adjust code.