Added documentation and improved firstrun check