tweaked: set input and output strings to be 256 chars and use strncpy instead of strcopy to avoid buffer overflow