brought project in working codition

lots and lost of commenting