removed unused collapse function