off-by-1s everywhere
K&R brackets, replaceString partially working