still messing with this.  probably should rewrite