Cleaned up code with updated reporting