add comments to better organize the distinct prototypes and logic