started implementing optimal scutiri algorithm