include lots of improvement from http://nihilex.com/secret-socks