implemented self timing phase comp. Fine tuning still required