Function rewrite, animation added