Tidied, updated copyright.