first commit of the macro to find optial d cut for BTV