still trying to make the old code work