Added options for interval and grid size. Fixed referenceErrors