Removed need for number of functions to be specified in an interface and added some sanity checking