012 Solved:
answer delayed because of check 'a!=b' (i!=return_val) left out initially