added mix and match feature functionality and also wrote weights to a file