Added draft of main skinning function.