init tim's code