Added interactive functions.

Added support for terminal input.