preliminary version, still needs major fixes
more fixes to preliminary version
basic version but need to re-write tests