Initial work for new algorithm