Improve the mark calculation