added full functionality!!!