Created working solution. Code still needs refactoring and cleanup of memory leaks.