reworking code bc of merge