Cleaned up initialization
Cleaned up code and flipped logic