moved legend, added delay to animate drawing of legend, cleaned up other stuff