updates to use patchwork more and some added tests