Changed some variable names to be more descriptive, added
more docs.