Made grid editable (plus some bits of tidying up)