added #52
added functional version of 52