Add function call statement and make if statement improvements