ported mix, added tests for mix