first working version after much testing and debugging (and learning) hope you enjoy it and find it useful/time saving