merged code with raph