Separated the forward pass and backward pass class.