Finalized v1.0 code