adding pieces from broken PR