Moved Functions to Headers and Source Files