added debug echo statements