Level logic added.