Added first draft of template delete function. #461