Made text placement more dynamic