If implementation

Generate function using if statements instead of hash maps