implemented the multiple node case in application layer