edited methods, rearanged