Defined separate method for string conversion
Created method to assign pairs