It's probably possible to make this more readable (by breaking javascript, hehe)