added an in-rect? function

uses given structures to determine if a posn is in a rectangle