made some optimisations and changed table drawing to verticalLines instead of path