added distinct
added Pattern for two nodes