removed unecessary code and add irq