split functions into functions.h
moves seeding to a function