added tests but collapse got broken somehow