Addition of best fit and worst fit

They all are working for one set of input file named inS.txt but issue
with in2.txt. As far as i could see you bestfit logic was checking for
firstkey rather then smallest value, i changed that.