Moved array initializations into functions
Reduced number of points