first version with tests etc.