stuff before switch