Configured POSTGRESQL database, and refined the algorithm for choosing the last name