fix subroutine stack bug, add more examples