updated from second branch