Added hooks and edited other files