Minor code updates

Renamed some variables, extended code commenting