align code with specification