changed interrupt method and added read input