finish basic implementation