first bunch of code to load animations from a file