Tidied up, made more user-friendly