the function itself is the easy part