Renamed some funtions to use normalized names. Added comments to group functional areas.