use 0 for trivial homotopy groups instead of 1 in a few places