A few important improvements: identity matrix and gap coverage checking