added performance stats, fixed javascript