refacotred timer handling and added pwmd14