Online scheduling algorithms for average flow time and its variants