Made some changes to your code

Hi,

I found your tunnel very useful but some changes were needed before it was 100%. I've also  re-indented the code a bit.