cleaned up front page and added some error checking.