Added gathering and logging and lotsa other stuff