Made corrections and added the first part of the functions and hooks