Reorganizing and Beautifying

Reorganizing the code a bit and adding better output (csv ready)