Code updated according to Coding Guidelines