updates to main page, cleaned up code