get_levels function

Get levels table