Added comments and pragma marks for readability/maintainability