Added comments to helper functions.