implymantation of simple Reference Monitor