fixed modal not hiding properly
added some documetation
tidy
tidied scripts