Wrote MaxN module to speed up results