Added working permissions system. Needs to be prettied up later