attempt at yields for a function