added edit functionality

I had to write this myself in hackathon this weekend, so I thought it would be a good idea to add this to your library.