Removed some terribad code and added some things