Data Structure and queries update