Improved seek function greatly