javascript worked for the first couple parts, don't know why it wouldn't work for the last part