Implemented tag queries using SdlSelector, fixed bugs, added comments