Develop

Updated algorithm