Added those useful methods again since they somehow disappeared and added comments.