Implemented forward pass.