Refactoring
Fixing bug with coverage function