moved all ints to long in production code, fixing tests