added assert()s