added reduce method; issues with type coersion, but seems to have correct application pattern