Add general input loop