Fully functional, albeit with appallingly messy JavaScript