some what working online mode, some debugging statements left