Making JS slightly more useful