Pass level to function