Rearranged order of functions in file.
Added quality-bias function.