Completed implementation. No testing yet.