So many instructions ...
Why don't you posted the code instead?
Would have helped...

Regards