Added lifecycle methods.

Lifecycle methods added. I can add comments, but I want fist let you know that this is done.