New animations stuff and some small code changes