debug work for leveling checking..still WIP