added comments updated to include gpl header and other misc info