outlines for main functions; changed tabs to spaces