Imported libraries and cleaned-up code

Imported libraries and refined comments; consolidated variable
initialization to the top of the of the public partial class