restructure and add R solutions