#228, fixed code
#228, added UML