first working draft
finish implementation