Added support for any patch sizes