added full functionality *untested but compiles*