realized there is a logic mistake here
consolodating temporary code