Added ondestroy and some comments