adding first pass logic