logic and animations implemented