Prabin - put some log statements and some assertions in the code