Completely Reorganized walksim for optimizing gains