Updated makegrid