Improved the efficiency of the solution by removing unecessary steps
Changed the way of getting the first element of the sequence