Debugged accordion removal, cleaned up functions