Added helper functions and IP address display when switching states