problem1 with working code