works logic