Moved width and left calculation into main module

There was a flickering effect when in the demo code. Will need to work
on this - as I believe the code shouldn't be fraternising with the
adoption code.