removed the character array, using different solution