I think it is good to use a little object oriented programming. for example create a class "stock" and add for example paid variable in it. In this way you have a better code and you can write more...