Corrected GA-Code