New code

Implemented new code