Efficient Memory Programming