Added support for automatic input