support comments in user-input; also add checks for buffer overflow