updated code to 4.0