EDIT: The program worked fine all along. I was just using incorrect input! Sorry, you can delete this thread.