Added new subroutine
Enhaced decode
Added output msgs