added function to personal functions with if and else. added returns