added an algorithm that wontt work due to integer sizes, need to use lookup tables.