Uses the container width for calculations

Tested locally, works perfectly.