almost done 7/29

A subroutine here would be useful.