updating paths (we should probably rewrite this function later)