Added animation code. Problem with thread due to class creation and no parent. To be revisited.