finished up the edit-feature. refactored quite a bit in the process. #4
fixed type