Bug fixes, added rendering of animation in main