Cleaned up logic - removed unused items carried over from cut/paste.