lvls function

Obtain levels from vector