added code for exercise
updated code and link