Code updates, comments and some cleaning