Finished code for viewing inbox