Got edit working and fixed bugs