adding the new algorithm for the basic working model