simplified version using insert