Using assert functions instead of ugly if's.