first partly working version