added more realistic example from snippet of github source code
wrote more complex/correct function to split element into attributes