trim and string to lower functions used