refactored, more stable algorithm to form listbox
refactored cl, cleaned debug info