A number of userful functions with tests