made collapse method void and took out toString