Latest changes merged with master 2

Implementation of the reporting functionality.