partially validated

did some validation, general cleanup, added in some performance
calculations.