Add comments and flesh out tests