added first part of problem49