Cleaned HAC function. Added init file to make the module importable