The Detroit Lions have had some tough years in handling the salary cap, but the upcoming offseason looks good for general manager Bob Quinn.

Salary cap management was not a strength of the Detroit Lions‘ Martin Mayhew-Tom Lewand led front office that was swept out just over a year ago. While they were misguided in sacrificing tomorrow for today, the lingering effects of their “kick the can down the road” cap management strategy is virtually over with Calvin Johnson’s dead money coming off the books after this season.

That puts new general manager Bob Quinn in a good position heading into 2017, so let’s take a back-of-the-napkin look at the Lions’ salary cap situation for next season.

Salary cap and contract tracking sites Over the Cap and Spotrac have estimated the 2017 salary cap at $166 million and $168 million respectively. Each team’s cap is adjusted from there based on things like cap carryover from the year before, giving each team a unique salary cap number for that season.

According to current NFLPA records, the Lions have about $5.3 million in unused 2016 cap space. So, the Lions’ cap for 2017 would be adjusted upward by the unused amount they carry over into 2017. If we take Over the Cap’s slightly more conservative 2017 cap estimate and add another $5 million on top in carry over money, the Lions would be looking at a total team cap of $171 million.

If we take the liberty of removing Brandon Pettigrew‘s contract from the team’s 2017 commitments, the Lions currently have about $128.3 million in 2017 cap charges on existing contracts and about $2.1 million in dead money. That makes for $130.4 million on the books against next seasons cap. Subtracting that from our assumed $171 million team cap, the Lions will have about $40.6 million in cap money to spend.

It’s important to note that the team’s 2017 commitments already on the books accounts for only 39 players, while the team’s top 51 contracts will count against the cap during the offseason. That leaves 12 roster spots that still need to be accounted for. Over the Cap projects the Lions’ seven 2017 NFL Draft picks to total about $5.4 million in rookie year cap charges, taking the roster up to 46 players and cap space available down to $35.2 million.

It’s also important to note which roster holes still need to be filled. Riley Reiff and Larry Warford are in the last year of their contracts and re-signing one or both takes a bite out of the available cap space. The Lions could go the less expensive route with Corey Robinson at right tackle and Joe Dahl or Laken Tomlinson at right guard, but Bob Quinn will have to at least back-fill the depth chart through either the draft or free agency.

There is also work to do on the defensive line. Ziggy Ansah‘s fifth-year option is accounted for above, but roster spots currently filled by defensive ends Armonty Bryant and Devin Taylor and defensive tackles Stefan Charles and Tyrunn Walker are not. Jon Bostic and Josh Bynes are also set to become free agents.

The draft can and will fill a couple needs, but Quinn will have some work to do this offseason. Fortunately, it looks like he will about $35 million at his disposal, although some of that will have to be held in reserve to deal with in-season roster moves.