This follows the second chapter of the hartl tutorial