clean up
added datetime conversion function
added general 2D metric