Added input loop