Much simpler implementation