Adjusted figure clearing, moved script to interactive page