Removed unnecessary code, removed unreliable check, cleaned up section of code.