working prototype. needs a lot of work and refectoring.