adjusted to pipeline, added verifications