implemented new structure
fixed todo