Changed all long ints to just ints, for performance and reduced code size.