added function to personal functions with if