add patch struct and patch resizing