basic functionality implemented; not fully tested