my lastest changes..code works when not in gdb