Cleaned up code, added bear functionality