Rearanged code...
fixes