minor changes, suing typedef instead of string