Enough of the confusing logic... time to redo this