Re-writing approach. Started unit tests.