Code reformatted to look better.