changed ints to unsigned longs