major refactoring
add ability to push stdin