Improved performance of local grid optimization; implemented grid recentering

Change-Id: I0fa1a3884919172fbf07097801e3e03b528553c2