Set up framework of functions required