modify output subroutine