Add variable replacing
Clean up and minor fixes
Grid started