fixed up optimal seed code