adjusted some of the logic in the open/closed function
Signed-off-by:Matthew Scaperoth <mscapero@gwu.edu>