Prefinal version with a few things left to add