expanded example, fixed void context to be compatible with all types