Code slightly amended.