Added mean removal for dense case