some little improvements. still a pain in the ass on plain python, need to look at pypy