Fixing up the pseudo code...too bad it's a faulty algorithm
finishing 5