Check functions

Closes #45 and #105