Updated most HTC code