implement error reporting
implement values checking