Added constructors, fixed all syntactic errors and overhauled the entire
code layout. Tested and working.