tidied up, added license