new structure, updated code