output done. Still missing some details, but for now it works