Chopped out nonworking code and optimizing.