Funtion comments + getAcid() changes

1. Added comments to describe what each function does
2. Changed logic in getAcid() slightly to be a bit easier to understand