Added support for multiple paths, and added a beautification function