add const reference return values and parameters
improved animation code