continued on algorithm

Signed-off-by: Joppe Widstam <joppewidstam@hotmail.com>