Added delete note functionality.

and cleaned up some code!