First version of code (tests error)