first commit of working code

still needs refining and decisions regarding maps vs case