Revision 9 final

Just need to add comments (revision 10)