add R solution