Bugs partially fixed

still got bugs.