added full implementation