cym: adapting the code to use the TapHandle object