initial push of cmsy_if_collapse.R it's not working, but if someone else wants to look at it.