added solution for 31