Worked on mode changing and returning data