add some comments, fix platform recognition