made code pretty and added documentation for public methods