final,madigan6: Added comments and cleaned up my code