Fixed issue with pieces, reafctured tests, and removed some old code