Updated with criteria

Working on more complex criteria and queries