Removed global variables, refactored button animation