removed printf
improved code identation and main function. Also fixed bug on index for handling reports