Working program but need more testing.

Signed-off-by: Dmitry Gryazin <dosagc@gmail.com>