Almost the final version. Implement config.