Adding database and upgraded comparematrix.py