fixed two algorithm problems (bad random and bad initialization) + helper function for canvas sizing
fixed code to find next seed, previously biased