fixed some bugs, and GA code