A lot of cleanup, and permissions added