Fixed: use mean instead of median