$6.5m (2018) to make cap.
2017: $6.5m x 90% = $6.0m ($5.85m)
2018: $6.5m x 60% = $4.0m ($3.9m)
This solves your problem of being $0.5m over the cap, but you cannot add the two players you just won in free agency because you have $0.0m available.
You need to clear an additional $3.0m to add the 2 players you posted contracts for.