better file structure, added hash function