implemented bounce option (fixed #51), refactored animation code