added an initial buggy implementation