working baseline with some extra debug print statements