levels logic