Update functions.cpp

Small fix for issue #21