Fixed invisible selection bug, and modified some variable names to be more descriptive.