Enhanced and refactored chmod algorithm