Add comments and remove code that is not used