Fixed some bugs. Fixed logger's lock files.
Added case ranking algorithm.