Added class diagram and more comments