added interrupt logic but not implemented fully