expand to level function