newest code with bugs