Added dumb optimized version