use macro for reusable course display loops