First somehow working version