updates to bad physics code