Reorganized and made prettier