Cleaned up sink code