working on main for decoder