Improved consistency and clarity of names
Updated to work with drive code
Fixed general formatting errors
Revised comments and fixed minor bugs