Made example1 better, changed ErrorCodes to enum class