chapter 7 algorithm 35 implemented

Signed-off-by: Friker <viktor.tomkovic@gmail.com>