add tap function
add tests
incorporate addTap branch