reorganized and updated quite a bit