re-wrote replace_np, tested, works