tidied up code to remove interrupt legacys