Extended math and added partially working P2P