by using function