Changed shorts to ints. Cleaned up the main function.