FINAL REVISION, FULLY COMMENTED