implemented BIN properly