making simple space replacing work