script cleanup and added working grid