gentic algorithm is finally working fine