adding support for timer interrupt and multi-threading