updated string function, now working need to change var names