added class, and complete preliminar code need testing