work on new algorithm