Improved edge handling and added horizontal inertia