Fix reduce function and some notes