Code Refactorization/Dependency Removal

Removed dependency on System. Used Jagged arrays instead of multiple
objects. Code is less than 100 lines.