All the functions changed to works with Pandas libarry