There is no doubt, there are lots of Opening and Closing Balance related questions on StackOverflow, But believe us, I have lots of tries to apply those examples in my case.