fixed nested selectors and added jasmine tests