Tidied left over function definitions