ENH: complete implementation, refactored tiled code out. passes all 6 test cases