Some code clean up; added __len__.