added io script,added bugs, and deleted misc code