moved all the allocation to selfBegin and deallocation to selfEnd
added a couple more things to selfEnd()