implemented more continuous form of planarity energy function