Done with algo 6
Added algorithm 3