Adaptive Moving-Mesh Algorithm