finishing version 1.0 code