This code completes problem set 1 of cs50x