change the logical to meet the demands of the CSE120. Need to be tested