removed sumSequence and adjusted