Implemented conditional rendering and file reading