added decode2 and created a new main function
removed main