first draft - not proper working yet