rearranged how variables are set in reducer; formatting in mapper.