first major commit...code needs major refactoring