cleaned up and added expamples, comments, and refernece.