Working version with binary coding
Added mutation and selection function