Implement without using lists