Improvements thanks to Lukas_