Changes in algorithm

Changes in algo for calculating number of notes