update pieces, fix bugs