Added documentation and Entry class
Bug fixes in the algorithm