major changes so that this works