Added InputWithClass method