In reply to javatea:
Thanks for the reply Javatea. The problem with the above solution is that, available need not to be changed as it will be coming from some parameter which has to be fixed.In the above solution “available” will also get randomize which is not required .