If/else support and added tests