Add more commenting to functions