Program now works