Old downtown courthouse being turned into affordable housing