Changed footer and some optimisations for python 2.7