Added more features and did some reordering.