added structure to all functions of library