hf5 and matrix class