Added some comments and configurability