Alterations and resolution of singularities