bug fix and rearanging gcc build