make the code more regular (strncpy instead of pointer asst)