third commit, the basic idea now works