reorganized methods to be top down