sample function writing