added remaining arguments to onepath subroutine