EOF and clean up code