finished algorithim, need to add file loader