rearanged functions