Useful functions and a driver