k and r exercises