added relative selector support and added test coverage