Tidied up methods and added control attributes.