some cleanup and fixed two examples