working grid optimized code for Van der Waals