Phase2 hgx9

Code cleaned up