Complete over-haul of original CodeRight