Cleaned up the getip and getport methods. Added some testing