Move input and procesing time, otim to separate routine