final version with function header comments and working solve animation