First pass at recFun.cpp