calculate percentage - fix #50