coded first working version