fixed logic in two of the operations