major rewrite for 2.0

saving old code for now