Removed carriage returns from ends of lines.
Added first version of a timeout function.