Implemented accessVar and added hooks