Finished ps1.c