reintegrate original code changes