finished lab5 without tempfile