Managing the bed crunch in hospitals