legality isn't 100% working. It doesn't check if there's a same piece somewhere down the line -.-