You're probably right, I made some hidden states here that makes it counter intuitive. I'll revise the code to a more transparent form.