changed some subroutine names to increase clarity