almost 100% working. Added hash structure