modified version of string format functionality