added r code and question interaction