implemented subroutine