IPv6 added and some other good code practices included.