updated source.  better use of variables.  more efficient