add new function to implement foo