WIP on main concept
Changed printf to fprintf