Third animation segment complete and some code refactoring