some effort into writing subroutines