fixing algorithm startup