Migrated doPost from assignment3