added editing and deleting functions to subjects