added header and some comments