Needs testing, appears to work for C = 40 and 76