Tidied up functions - pretesting.