added preliminary polygon editing in separate js file