just realized this could be done better.  see comment below.