Added a whole whack of stuff for calculating element positions