Implement if2 and if3

+ added if2 and if3
+ added tests for if2 and if3