First try, separates main into more functions
Added a separate function for revenue report