implemented if and tests for if