Rewrote editing code, lots of new console.logging for now.