added readme and latextemplae
completed documentation
cleaned up the code