Completed the functions for the PA 2