Lots of Logic Code, still some bugs