func prog assignment 3