algorithm implemented

Signed-off-by: Vylyb <philipp-hempel@gmx.de>