That's one of the many things you need to learn and is probably what you need to use here, but since you have not shown us your code or given a clear explanation of what you need to do, we can only make guesses. My crystal ball broke many years ago.