Added some code. Not checked. Not compiled. Not works )