Added some (slightly buggy) animation code