using Hashtable for matrices