first working model (with bugs)