added dropLast function