adding permissions and improved output