Version 1.2

fully revised code