Code fully subroutined