Searching for foldable protein structures using optimized energy functions