Added code and test code for 3 and 4 nodes (Incomplete)