Fixes #4 by using annotated function rather than