Added a nice function to split source & header files dynamically which I found on the internet