Added initial functions and readin