A. Fix bug when vector length is zero, there will be a devided by zero problem