implemented mutation operator and some minor changes/cleanups