Code adapted to new version of Love2d