Created completely broken algorithm that DOESN'T CRASH.
Holy mother of Zeus' left nipple. It seems to work.
Setting ip to 'localhost' seems like the most sensible atm