Code now works for non-zero c5