first version passing basic tests