add tests and fix bugs
add tapes:false option to input
refactoring