Final code commmit, added permission fixes