Updated code to have basic life time simulation.