Major Fixes. Code cleanup. Barebones edit functionality