Copied the old gratisu computer algebra code