Implemented mix function