Finish base code, needs reorganization