removed unnecessary if statements.