first version that roughly works