implemented if and else-part