initial version of skeleton, still needs some testing