big rewrite, those ifs and ifs..