similar thinking here, but this will be easier because the function is smaller