add some functions from paul