tidied up code
changed markdown documentation