More documentation and better method names.
Fix detecting the selected units.