merged with two branches: Yan's and mine.
changed few minor errors.
stylized.
started finalizing
added files from Yan's branch.