First roughly working version