Working implementation, a bit coarse