Fixed calculation of MAP metric to match literature, Optimize feature now works