sketch out algo