Tidy-up (done for all the functions presented in this version)