So both times you call filltable()?

The code you posted so far has nothing to do with filltable()

How do you expect help if your program is doing something totally different than what you post?

Cheers,
_