reorganized; added load functions