first go at return type checking (untested)