cleanup of code formatting + more working unit tests