updated tests for cubic permutations test
finished tests, refactored code