Changed bitwise-& to logic &&, fixed allot of bugs