Tidied up Javascript File