Added adjust_ms routine