Integrated new code, fixed indentation
failed merge, will try again