add full functionality handling cases - return value has to be fixed