Documentation added

Added documentation everywhere to any functions/fields that might be
unclear for what their purpose is.