first version that successfully runs on test data