re-wrote animation class