code cleanup, completes initial quad work