added in some echoes to trace where things are going wrong