Added getLevel() function