stock function exercise revised