Made ints static and added thread