Added comments, improved loggin and refactored some parts
14 files changed