Cleaned up code by moving split into seperate function, and changed backgrounds of new layers from transparent to white