added code from book problem in seperate file