added and tested IP functions