add time managment
First final version