use subroutine instead of change level instant