Implementation of N-Chance algorithm

Implementation is halfway. To be completed by week 9