Added a bottom layer for slopes to properly work
Added missing semicolons
Extracted animation deciding to its own function