more functions and helper functions
getLog function
ip <-> int conversion changed