Experimenting with some r code