added a match_cubes function
minor bugfixes, deprecation cleanup