Added logarthms.

Also some oldfag copypasting and heavy narcotics.