Changed variables types

Changed variables types to save memory and optimize code a bit