functions from Mary