add fancybox, clean up code