Added and updated comments and added some new tests